package demo11;

import java.util.Scanner;
public class Main{
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        int a = scanner.nextInt();
        int[] arr = new int[32];
        for(int i = 0; i < 32; i++) {
            arr[i] = a & 1;
            a >>= 1;
        }
        int count = 0;
        for(int i = 0; i < 31; i += 1) {
            if(arr[i] == 1 ){
                count ++;
            }else if(arr[i] == 1 && arr[i+1] == 0) {
                count += 1;
            }
            }

        System.out.println(count);
        
        
    }
    
    
}